<template>
  <view class="mine-container">
    <!--    <nav-bar title="我的" ref="navBarRef" />-->
    <wechat-info ref="wechatInfoRef" />
    <low-code-page ref="lpgs" hideNavbar v-if="pageData" :pageJson="pageData" />
    <cus-tabbar />
  </view>
</template>

<script>
import { getPageJson } from "@/service/api/sp-common/widget";
import wechatInfo from "@/components/pageComponents/mine/wechat-info";
export default {
  data() {
    return {
      options: {},
      pageData: null,
    };
  },
  components: {
    wechatInfo,
  },
  onLoad(options) {
    uni.showLoading({
      title: "加载中",
    });
    this.options = options;
    this.$nextTick(() => {
      this.initLowCodePage();
    });
  },
  methods: {
    initLowCodePage() {
      const { pageId } = this.options;
      if (pageId) {
        getPageJson({ id: pageId }).then((res) => {
          if (res) {
            uni.hideLoading();
            this.pageData = JSON.parse(res.pageJson);
          }
          console.log("页面配置", res);
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped></style>
